import 'package:flutter/material.dart';

class ListWheelScrollViewPage extends StatefulWidget {
  @override
  _ListWheelScrollViewPageState createState() =>
      _ListWheelScrollViewPageState();
}

class _ListWheelScrollViewPageState extends State<ListWheelScrollViewPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('滚动组件'),
      ),
      body: RotatedBox(
        quarterTurns: 1,
        child: ListWheelScrollView(
          itemExtent: 100,
          physics: FixedExtentScrollPhysics(),
          magnification: 1,
          overAndUnderCenterOpacity: 0.5,
          children: List.generate(
            20,
            (index) => RotatedBox(
              quarterTurns: -1,
              child: Container(
                color: Colors.blue,
                alignment: Alignment.center,
                child: Text(
                  "$index",
                  style: TextStyle(fontSize: 30),
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}
